package org.example.json.enumeration;

public enum Color {
    RED(100), YELLOW(200), GREEN(300);
    private int value;

    Color(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static Color valueOf(int value) {
        switch (value) {
            case 100:
                return RED;
            case 200:
                return YELLOW;
            case 300:
                return GREEN;
            default:
                return null;
        }
    }
}